// motors
#include <Arduino.h>
#include "motors.h"
#include "config.h"

void stopp()
{
  digitalWrite(MOTOR_ENABLE,LOW);
}

void forward(int mspeed)
{
  stopp();
  digitalWrite(MOTOR_DIR,LOW);
  analogWrite(MOTOR_ENABLE,mspeed); 
}

void back(int mspeed)
{
  stopp();
  digitalWrite(MOTOR_DIR,HIGH);
  analogWrite(MOTOR_ENABLE,mspeed);
}
void motor_init()
{  
  pinMode(MOTOR_ENABLE, OUTPUT);
  digitalWrite(MOTOR_ENABLE,LOW);
  pinMode(MOTOR_DIR, OUTPUT);
}
